<?php
/**
 * Created by PhpStorm.
 * User: Mitol
 * Date: 2015/7/31
 * Time: 20:34
 */

namespace Home\Controller;
use Think\Controller;
//use Home\Model;


class GoodsController extends Controller {
    /*
     * 获取拼购商品通过单价
     */
    public function getBingoByUnitPrice($unitPrice) {
        if(!empty($unitPrice)) {
            $bingo = D('GoodsDetailInfoView');
            return $bingo->queryByPriceLevel($unitPrice);
        } else {
            return false;
        }
    }

    /*
     * 查找出所有的拼购商品
     */
    public function queryAllLotteryGoods() {
        $lotteryGoods = D('GoodsDetailInfoView');
        var_dump($lotteryGoods->queryAll());
        echo $lotteryGoods->getLastSql();
    }

    /*
     * 通过商品品牌ID搜寻出一组商品中符合的商品
     */
    public function getGoodsByTypeID($goods, $typeID) {
        if(!empty($goods) && !empty($typeID)) {
            foreach($goods as $good) {
                if($good[''] == 1) {

                }
            }
        }
    }
}